package controller;

import model.Product;
import web.annotation.Method;
import web.annotation.Param;
import web.annotation.Type;
import web.jdbc.QuerySQL;

@Type("productController")
public class ProductController {
	QuerySQL<Product> qs = new QuerySQL<>();
	
	private Product product;
	
	private boolean b;
	
	public boolean isB() {
		return b;
	}

	public void setB(boolean b) {
		this.b = b;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}


	@Method(value = "add",isReturnPage = true)
	public String productAdd(@Param("product")Product product){
		System.out.println(product);
		qs.insertData(product);
		return "WEB-INF/page/ProductAdd.jsp";
	}
}
